<?php defined('IN_YuLin') || exit('NO PERMIT!'); ?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>彩种管理 - 后台管理系统</title>
        <meta name="renderer" content="webkit|ie-comp|ie-stand">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
        <link rel="stylesheet" type="text/css" href="static/css/font-awesome.min.css"/>
        <link rel="stylesheet" href="static/css/style.css">
    </head>
    <body>
        <div class="subnav">
            <a href="">首页</a> &gt; <a href="">系统管理</a> &gt; 彩种管理
        </div>
        
        <div class="main-inner">
            <div class="x-body">
                <div class="tablefilter">
                    <div class="tablebutton">
                        <a href="?m={$m}&c={$c}&a=add" class=""><i class="fa fa-plus"></i>新增</a>
                    </div>
                </div>

                <table class="layui-table">
                    <thead>
                        <tr>
                            <th>选择</th>
                            <th>名称</th>
                            <th>排序</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody id="datalist">
                        {loop $menuTreeData as $k => $v}
                            <tr>
                                <td>
                                    <input type="checkbox" name="" />
                                </td>
                                <td style="text-align: left;">{$v['line'] . $v['name']}</td>
                              	<td>{$v['sort']}</td>
                              	<td>
                              		<a href="?m={$m}&c={$c}&a=edit&id={$v['id']}" class="">修改</a> |
                              		<a href="?m={$m}&c={$c}&a=add&id={$v['id']}" class="">增加子级</a> |
                              		<a href="javascript:;" data-id="{$v['id']}" class="delete">删除</a> 
                          		</td>
                            </tr>
                        {/loop}
                    </tbody>
                </table>
            </div>
        </div>
        <script type="text/javascript" src="static/js/jquery.min.js"></script>
        <script>
        $(function(){
            $(".delete").on('click',function(){
                if(confirm("确定要删除吗？")){
                    var id = $(this).attr('data-id'), url = "?m=lottery&c=category&a=del&id="+id;
                    $.get(url, function(data){
                        data = eval('('+data+')');
                        alert(data.msg);
                        window.location.reload();
                    });
                }
            });
        });
        </script>
    </body>
</html>
